import Vue from 'vue'
import App from './App.vue'
import router from './router'

Vue.use(router)
// 映入ui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.config.productionTip = false
Vue.use(ElementUI);
// 使用axios
import axios from 'axios';
Vue.prototype.$axios=axios 
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
axios.interceptors.request.use(config => {
  // console.log(config);
  config.headers.Authorization = window.sessionStorage.getItem('token');
  // 在最后必须return 
  return config
})

// main.js
// import mock from '../mock/index'
// Vue.use(mock);
new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
